<script lang="ts" setup>
import CommonPage from "@/newComponents/CommonPage.vue";
import { formatter } from "@/utils/formatterUtils";
import LzLinkAPI from "@/api/content/z-link";
import LinkDialog from "@/views/content/lz-link/LinkDialog.vue";

const pageRef = ref();
</script>
<template>
  <common-page ref="pageRef" :page-api="LzLinkAPI" :component="LinkDialog">
    <template #formContent="{ filters }">
      <el-form-item label="网站名称" prop="name">
        <el-input v-model="filters.name" placeholder="请输入网站名称" clearable></el-input>
      </el-form-item>
    </template>
    <template #tableContent>
      <el-table-column key="id" label="id" prop="id" min-width="150" align="center" :formatter />
      <el-table-column label="网站名称" prop="name" align="center" :formatter />
      <el-table-column label="logo" prop="logo" align="center" :formatter="formatter">
        <template #default="{ row }">
          <img :src="row.logo" alt="logo" style="width: 80px; height: 80px" />
        </template>
      </el-table-column>
      <el-table-column label="描述" prop="description" align="center" :formatter="formatter" />
      <el-table-column label="网站地址" prop="address" align="center" :formatter="formatter" />
      <el-table-column label="审核状态" prop="status" align="center" :formatter="formatter">
        <template #default="{ row }">
          <el-tag v-if="row.status === '0'" type="success">审核通过</el-tag>
          <el-tag v-else-if="row.status === '1'" type="danger">审核未通过</el-tag>
          <el-tag v-else type="warning">未审核</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="创建人" prop="createBy" align="center" :formatter="formatter" />
      <el-table-column label="更新人" prop="updateBy" align="center" :formatter="formatter" />
    </template>
  </common-page>
</template>
<style lang="scss" scoped></style>
